Skip to content

Conversation

@pmenzel
Copy link
Collaborator

@pmenzel pmenzel commented Sep 11, 2026

$ openscad --version
OpenSCAD version 2021.01

CGAL is a C++ library of computational geometry algorithms.  openscad uses
it for its exact CSG kernel, so it is needed to build openscad.

The upstream *-library tarball is the header-only distribution without the
examples, demos and test suite, so there is nothing to compile: the package
just installs the headers plus the CMake config files.

5.6.3 is the last release of the 5.x branch, released on 2025-08-22.
CGAL 6 removed a number of interfaces that openscad 2021.01 still uses, so
do not go beyond 5.x until openscad is updated.

Assisted-by: Claude Opus 5 <noreply@anthropic.com>
OpenCSG renders constructive solid geometry on the GPU with image-based CSG
algorithms.  openscad uses it for the interactive preview, so it is needed
to build openscad.

Version 1.8.2 was released on 2025-01-05.  Only the library and its single
header are installed; upstream’s example is a GLUT demo that is never
installed, so turn it off and avoid the freeglut dependency:

    /usr/lib/libopencsg.so.1.8.2
    /usr/lib/libopencsg.so.1
    /usr/lib/libopencsg.so
    /usr/include/opencsg.h

Assisted-by: Claude Opus 5 <noreply@anthropic.com>
OpenSCAD is a script-only 3D CAD modeller: the model is described in its
own declarative language and rendered from constructive solid geometry,
making it a good fit for parametric parts and for keeping designs in
version control.

2021.01, released on 2021-02-07, is still the latest release; upstream has
published development snapshots only since then.  The tarball bundles the
MCAD library, so no submodule handling is needed.

MarIuX’ boost is configured with `--with-libraries=headers`, so `/usr/lib`
holds no libboost_* at all and the link fails:

    /usr/lib/gcc/x86_64-pc-linux-gnu/12.5.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lboost_thread: No such file or directory
    /usr/lib/gcc/x86_64-pc-linux-gnu/12.5.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lboost_program_options: No such file or directory
    /usr/lib/gcc/x86_64-pc-linux-gnu/12.5.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lboost_filesystem: No such file or directory
    /usr/lib/gcc/x86_64-pc-linux-gnu/12.5.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lboost_system: No such file or directory
    /usr/lib/gcc/x86_64-pc-linux-gnu/12.5.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lboost_regex: No such file or directory
    collect2: error: ld returned 1 exit status

Take boost from `/pkg/boost-1.86.0-0`, which ships the compiled
libraries.  Its headers have to precede /usr/include so that the 1.86.0
headers, and not the 1.72.0 ones, match the libraries; QMAKE_RPATHDIR
makes them findable at runtime without a profile:

    RPATH                /pkg/boost-1.86.0-0/lib:/usr/local/qt5/lib

Four patches are required, three for the CGAL 5.6.3 and one for the boost
1.86.0 built against:

    src/cgalutils-tess.cc:22:15: error: ‘Triangulation_2_filtered_projection_traits_3’ in namespace ‘CGAL’ does not name a template type; did you mean ‘Triangulation_2_projection_traits_3’?
    src/cgalutils-polyhedron.cc:346:29: error: ‘generic_print_polyhedron’ was not declared in this scope
    src/openscad.cc:310:71: error: call of overloaded ‘join(std::__cxx11::list<std::__cxx11::basic_string<char> >, const char [2])’ is ambiguous
    src/FileModule.cc:68:25: error: ‘is_regular’ is not a member of ‘fs’; did you mean ‘is_regular_file’?

The build has to happen in the source directory.  qmake looks for feature
files only in a `features` directory below the *build* directory, so in a
shadow build openscad’s own features/*.prf – which is where every
dependency except Qt is detected – are silently skipped and the build dies
with

    src/CGALCache.cc:27:10: fatal error: Eigen/Core: No such file or directory
       27 | #include <Eigen/Core>
          |          ^~~~~~~~~~~~

Verified by rendering a CSG difference headlessly, which exercises the exact
CGAL kernel and the STL exporter:

    $ openscad -o t.stl t.scad
    Geometries in cache: 3
    […]
       Facets:        466
       Volumes:         2
    $ grep -c 'facet normal' t.stl
    880

Assisted-by: Claude Opus 5 <noreply@anthropic.com>
@pmenzel pmenzel merged commit c0f533f into master Sep 11, 2026
Sign in to join this conversation on GitHub.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant